<?php

/**
 * demo 
 */

namespace app\api\controller;

use app\api\Base;
use think\Config;
use com\gdl\newagk\interfaces\DemoServiceClient;
use com\gdl\newagk\dataobject\demo\DemoInfoResultDTO; 
use think\Db;

class Demo extends Base
{

    public function demo() 
    {
		$result = array();
        $demoid = $this->request->param('demoid') ? $this->request->param('demoid') : 0;  
        try {
            \ApiClient::init(Config::get('api.appid'), Config::get('api.secret'), 30, array('gdlAgkSdk'));
            $demoApi = new DemoServiceClient(NULL);
			
            \ApiClient::build($demoApi);
			
            $result = $demoApi->demo($demoid);
			//var_dump($result);exit;
        } catch (Exception $ex) {
            \SLogger::getLogger('pub_thrift_service', 'thrift_error')->error('thrift call error', $ex);
        }
        return json_encode($result);
    }
	
	 
}
